﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using System.Resources;

namespace SampleResourceBundle
{
    public partial class Form2 : Form
    {
        private ResourceBundle resBundle;

        public Form2()
        {
            InitializeComponent();
            resBundle = ResourceBundle.GetInstance();
        }

        public override void Refresh()
        {
            this.Text = resBundle.GetString("Form2", "title");
            this.m_lbl1.Text = resBundle.GetString("Form2", "helloText");
            this.m_btn1.Text = resBundle.GetString("Form2", "buttonText");

            base.Refresh();
        }

        private void m_btn1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            ///////////////////////////
            //This has to be called at Load to put the correct language in 
            this.Refresh();
            //////////////////////////
        }
    }
}
